<?php

namespace app\index\util;

use think\paginator\driver\Bootstrap;
use think\Request;

class Page extends Bootstrap
{
    public static function ready($listRows, $currentPage = null, $total = null, $options = [])
    {
        // 自动构建
        $options = [
                'path' => Request::instance()->baseUrl(),
                'query' => self::get_query(),

            ] + $options;
        return parent::make([], $listRows, $currentPage, $total, false, $options);
    }
    public static function get_query() {
        // 获取地址参数
        $request = Request::instance();
        parse_str($request->query(), $query);
        return $query+$request->post('',[]);// 混合post
    }
}